/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkgMetodoPyramid.pkgReporte;

import net.sf.jasperreports.engine.JRException;
import org.jfree.chart.JFreeChart;
import pkgMetodoPyramid.pkgPresentacion.PllaGraficosPyramid;
import pkgMetodoPyramid.pkgReporte.pkgGraph1.GestorGraph1;
import pkgMetodoPyramid.pkgReporte.pkgGraph2.GestorGraph2;
import pkgMetodoPyramid.pkgReporte.pkgGraph3.GestorGraph3;

/**
 *
 * @author Administrador
 */
public class GestorGraficos {
    
    private GestorGraphPyramid gestorGraph1;
    private GestorGraphPyramid gestorGraph2;
    private GestorGraphPyramid gestorGraph3;
    private BDataRptChart dataRptChart; 
    
    public GestorGraficos(BDataRptChart dataRptChart) {
        this.dataRptChart=dataRptChart;
        gestorGraph1=new GestorGraph1();
        gestorGraph1.setDataRptChart(dataRptChart);
        gestorGraph2=new GestorGraph2();
        gestorGraph2.setDataRptChart(dataRptChart);
        gestorGraph3=new GestorGraph3();
        gestorGraph3.setDataRptChart(dataRptChart);
    }
    
    public void mostrarGraficos() throws ProcessGraphException, JRException {
        gestorGraph1.generarGrafico();        
        gestorGraph2.generarGrafico();
        gestorGraph3.generarGrafico();
        PllaGraficosPyramid plla = new PllaGraficosPyramid(this);
        plla.abrirPantalla();
    }
    
    public JFreeChart getChartGraph1Varones(){
     return gestorGraph1.getChartVarones();
    }
    
    public JFreeChart getChartGraph1Mujeres(){
     return gestorGraph1.getChartMujeres();
    }
    
    public JFreeChart getChartGraph2Varones(){
     return gestorGraph2.getChartVarones();
    }
    
    public JFreeChart getChartGraph2Mujeres(){
     return gestorGraph2.getChartMujeres();
    }
    
    public JFreeChart getChartGraph3Varones(){
     return gestorGraph3.getChartVarones();
    }
    
    public JFreeChart getChartGraph3Mujeres(){
     return gestorGraph3.getChartMujeres();
    }
    
    public void generarReporteGraph1() throws ProcessReportException, JRException{
     gestorGraph1.generarReporte();
    }
    
    public void generarReporteGraph2() throws ProcessReportException, JRException{
     gestorGraph2.generarReporte();
    }
    
    public void generarReporteGraph3() throws ProcessReportException, JRException{
     gestorGraph3.generarReporte();
    }

    /**
     * @return the dataRptChart
     */
    public BDataRptChart getDataRptChart() {
        return dataRptChart;
    }
    
}
